package org.example.service.impl;

import org.example.entity.Players;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MongoService {
    @Autowired
    private MongoTemplate mongoTemplate;

    public void save(Players players){
        mongoTemplate.save(players,"players");
    }

    public List<Players> findAll(){
       return mongoTemplate.findAll(Players.class,"players");
    }
}
